package com.example.VolunteerBank.mapper;

import com.example.VolunteerBank.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    //根据名字查找用户
    @Select("select * from user where username = #{username}")
    User findByUsername(String username);

    //添加用户
    @Insert("insert into user(username, password, create_time, update_time) VALUES (#{username}, #{password}, #{createTime}, #{updateTime})")
    void add(User user);

    //更新用户详细信息
    void update(User user);
}
